package com.db.stexchem.message;

public class ExecutionReport extends Data {
  
  private boolean fullyFilled = true;
  private int orderNo;
  private int nShares;
  private float price;
  private String counterparty;
  private Operation operation;
  private String stockName;

  public ExecutionReport() {
  }

  public boolean isFullyFilled() {
    return fullyFilled;
  }

  public void setFullyFilled(boolean fullyFilled) {
    this.fullyFilled = fullyFilled;
  }

  public int getOrderNo() {
    return orderNo;
  }

  public void setOrderNo(int orderNo) {
    this.orderNo = orderNo;
  }

  public int getNShares() {
    return nShares;
  }

  public void setNShares(int nShares) {
    this.nShares = nShares;
  }

  public float getPrice() {
    return price;
  }

  public void setPrice(float price) {
    this.price = price;
  }

  public String getCounterparty() {
    return counterparty;
  }

  public void setCounterparty(String counterparty) {
    this.counterparty = counterparty;
  }

  public Operation getOperation() {
    return operation;
  }

  public void setOperation(Operation operation) {
    this.operation = operation;
  }

  public String getStockName() {
    return stockName;
  }

  public void setStockName(String stockName) {
    this.stockName = stockName;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    ExecutionReport other = (ExecutionReport) obj;
    if (counterparty == null) {
      if (other.counterparty != null)
        return false;
    } else if (!counterparty.equals(other.counterparty))
      return false;
    if (fullyFilled != other.fullyFilled)
      return false;
    if (nShares != other.nShares)
      return false;
    if (operation != other.operation)
      return false;
    if (orderNo != other.orderNo)
      return false;
    if (Float.floatToIntBits(price) != Float.floatToIntBits(other.price))
      return false;
    if (stockName == null) {
      if (other.stockName != null)
        return false;
    } else if (!stockName.equals(other.stockName))
      return false;
    return true;
  }

  @Override
  public String toString() {
    return "ExecutionReport [fullyFilled=" + fullyFilled + ", orderNo="
        + orderNo + ", nShares=" + nShares + ", price=" + price
        + ", counterparty=" + counterparty + ", operation=" + operation
        + ", stockName=" + stockName + "]";
  }

}
